/*
	Abar for acan
	www.abans.cn	abans@qq.com
	2010-10-08
*/

var Abar_conf = new Array();
Abar_conf.nav = new Array();
Abar_conf.nav[0] = new Array();
Abar_conf.nav[0].title = '打开菜单';
Abar_conf.nav[0].name = '菜单';
Abar_conf.nav[0].url = 'JavaScript:Abar.menu()';
Abar_conf.nav[1] = new Array();
Abar_conf.nav[1].title = '点击登入';
Abar_conf.nav[1].name = '登入';
Abar_conf.nav[1].url = 'JavaScript:Acan.login.show()';
Abar_conf.nav[2] = new Array();
Abar_conf.nav[2].title = '点击注册';
Abar_conf.nav[2].name = '注册';
Abar_conf.nav[2].url = 'JavaScript:Acan.login.reg()';

Abar_conf.app = '2';



function Abar(){}
	//初始化
	Abar.ready = function(){
		Abar.html.ready()
	}
	Abar.run = function(){
		return;
	}
	Abar.menu = function(){
		return;
	}
//====================================================================================================
	//获取数据
	Abar.get = function (){}
		//获取nav数据
		Abar.get.nav = function(){
			var data = Abar_conf.nav;
			return data;
		}
		//获取app数据
		Abar.get.app = function(){
			var data = Abar_conf.app;
			return data;
		}
//====================================================================================================
	//html代码添加
	Abar.html = function (){}
		//载入body
		Abar.html.ready = function(){
			jQuery("body").append('<div id="abar_body" class="abar_body"></div>');
			jQuery("#abar_body").append('<div id="abar_nav" class="abar_nav"></div>');
			Abar.html.nav();
		}
		//载入菜单
		Abar.html.nav = function(){
			jQuery("#abar_nav").append('<ul id="abar_nav_ul" class="abar_nav_ul"></ul>');
			var app_list = Abar.get.app();
			var nav_list = Abar.get.nav();
			if(nav_list.length > 0){
				for(x in nav_list){
					jQuery("#abar_nav_ul").append('<li id="abar_nav_li'+x+'" class="abar_nav_li"><a href="'+nav_list[x].url+'" title="'+nav_list[x].title+'">'+nav_list[x].name+'</a></li>');
				}
			}
		}
		


jQuery(document).ready(function(){
	Abar.ready();
})